﻿@model WeProjects.Models.MemberViewModel

@{
    ViewBag.Title = "Create";
}
<style type="text/css">
    input[type="text"].text-box {
        width: 160px;
    }
</style>

<h2>新建用户</h2>
<p class="buttonIn">
    @Html.ActionLink("返回列表", "Index")
</p>

@using (Html.BeginForm()) {
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset class="form-horizontal">
        <legend>Member<small>（说明：初始密码为用户名）</small></legend>

        <div class="form-group">
            <label class="col-xs-2 col-md-2 control-label">用户名</label>
            <div class="col-xs-10 col-md-10">
                @Html.EditorFor(model => model.Name)
                @Html.ValidationMessageFor(model => model.Name)
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-2 col-md-2 control-label">姓名</label>
            <div class="col-xs-10 col-md-10">
                @Html.EditorFor(model => model.DisplayName)
                @Html.ValidationMessageFor(model => model.DisplayName)
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-2 col-md-2 control-label">电话</label>
            <div class="col-xs-10 col-md-10">
                @Html.EditorFor(model => model.Phone)
                @Html.ValidationMessageFor(model => model.Phone)
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-2 col-md-2 control-label">Email</label>
            <div class="col-xs-10 col-md-10">
                @Html.EditorFor(model => model.Email)
                @Html.ValidationMessageFor(model => model.Email)
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-2 col-md-2 control-label"></label>
            <div class="col-xs-10 col-md-10">
                @for (int i = 0; i < Model.RoleList.Count(); i++)
                {
                    @Html.CheckBoxFor(m => Model.RoleList[i].IsSelected)
                    <span>&nbsp;</span>@Model.RoleList[i].TranslatedRoleName
                    @Html.HiddenFor(m => Model.RoleList[i].RoleName)

                }
            </div>
        </div>

        @*<div class="form-group">
                <label class="col-xs-2 col-md-2 control-label"></label>
                <div class="col-xs-10 col-md-10">
                    <input type="checkbox" name="check" id="check" value="1" /> 是否为管理员
                </div>
            </div>*@
        <div class="form-group">
            <label class="col-xs-2 col-md-2 control-label"></label>
            <div class="col-xs-10 col-md-10">
                <input type="submit" value="新建" class="btn btn-success" />
            </div>
        </div>
    </fieldset>
}

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
